﻿@model EditTypePartViewModel
@using Orchard.ContentManagement.Metadata.Models
@using Orchard.ContentManagement.Metadata.Settings

@{
    var typePart = Model.TypePartDefinition;
}

<h1>@RenderTitleSegments(T["Edit Part - {0}", Model.DisplayName])</h1>

<div class="alert alert-success" role="alert">
    @T["Some part settings common to all types can also be defined at the <a href=\"{0}\">Part Definition</a> level.", Url.Action("EditPart", new { id = typePart.PartDefinition.Name })]
</div>

<form asp-action="EditTypePart">
    @Html.ValidationSummary()

    @if (typePart.PartDefinition.IsReusable())
    {
    <fieldset class="form-group">
        <div class="row col-sm-6">
            <label asp-for="DisplayName">@T["Display Name"]</label>
            <input asp-for="DisplayName" class="form-control" />
            <span class="hint">@T["Name of the part as it will be displayed in screens."]</span>
        </div>
    </fieldset>

    <fieldset class="form-group">
        <div class="row col-sm-6">
            <label asp-for="Description">@T["Description"]</label>
            <input asp-for="Description" class="form-control" />
            <span class="hint">@T["The description of the part as it will be displayed in screens."]</span>
        </div>
    </fieldset>
    }

    @await DisplayAsync(Model.Editor)

    <fieldset class="form-group">
        <button class="btn btn-primary" type="submit" name="submit.Save" value="Save">@T["Save"]</button>
    </fieldset>
</form>